home *** CD-ROM | disk | FTP | other *** search
File List | 1990-11-14 | 1.9 KB | 56 lines |
- ' Getting drive info from the
- ' boot sector!!!
- '
- ' drive% is the drive you want to
- ' check (0-A:, 1-B:)
- @getboot(0)
- END
- '
- PROCEDURE getboot(drive%)
- DIM sector|(512)
- sectadd%=VARPTR(sector|(0))
- ~XBIOS(8,L:sectadd%,L:0,drive%,1,0,0,1)
- serial%=(sector|(10)*&H1000)+(sector|(9)*&H100)+sector|(8)
- ' Note: Boot sector info is in low-byte, high-byte form
- bps%=(sector|(12)*&H100)+sector|(11)
- spc%=sector|(13)
- res%=(sector|(15)*&H100)+sector|(14)
- nfats%=sector|(16)
- ndirs%=(sector|(18)*&H100)+sector|(17)
- nsects%=(sector|(20)*&H100)+sector|(19)
- media%=sector|(21)
- spf%=(sector|(23)*&H100)+sector|(22)
- spt%=(sector|(25)*&H100)+sector|(24)
- nsides%=(sector|(27)*&H100)+sector|(26)
- nhid%=(sector|(29)*&H100)+sector|(28)
- execflg%=(sector|(31)*&H100)+sector|(30)
- ldmode%=(sector|(33)*&H100)+sector|(32)
- ssect%=(sector|(35)*&H100)+sector|(34)
- sectcnt%=(sector|(37)*&H100)+sector|(36)
- ldaddr%=(sector|(41)*&H10000)+(sector|(40)*&H1000)+(sector|(39)*&H100)+sector|(38)
- fatbuf%=(sector|(45)*&H10000)+(sector|(45)*&H1000)+(sector|(43)*&H100)+sector|(42)
- bootname$=CHAR{sectadd%+46}
- PRINT "Disk serial number: ";serial%
- PRINT "Bytes per sector: ";bps%
- PRINT "Sectors per cluster: ";spc%
- PRINT "Number of reserved sectors: ";res%
- PRINT "Number of FATs: ";nfats%
- PRINT "Number of possible directory entries: ";ndirs%
- PRINT "Number of sectors on disk: ";nsects%
- PRINT "MEDIA description: ";media%
- PRINT "Sectors per FAT: ";spf%
- PRINT "Sectors per track: ";spt%
- PRINT "Number of sides: ";nsides%
- PRINT "Number of hidden sectors: ";nhid%
- PRINT "Flag for COMMAND.PRG: ";execflg%
- PRINT "Flag for file or sector boot: ";ldmode%
- PRINT "First sector to be loaded: ";ssect%
- PRINT "Number of sectors to load: ";sectcnt%
- PRINT "Load address: ";ldaddr%
- PRINT "FAT address: ";fatbuf%
- PRINT "Boot program filename: ";bootname$
- PRINT
- PRINT "Press a key to continue"
- ~INP(2)
- RETURN
-